package loginFlash
{
	import flash.display.Bitmap;
	import flash.display.Sprite;
	import flash.events.Event;
	
	[SWF(width="1000",height="600",backgroundColor="#000000")]
	public class Login extends Sprite
	{
		[Embed(source="assets/general/general_20_1.png")]
		private var pic1:Class;
		[Embed(source="assets/general/general_6_1.png")]
		private var pic2:Class;
		[Embed(source="assets/general/general_7_1.png")]
		private var pic3:Class;
		[Embed(source="assets/general/general_1_1.png")]
		private var pic4:Class;
		[Embed(source="assets/general/general_4_1.png")]
		private var pic5:Class;
		
		private var gen1:Bitmap,gen2:Bitmap,gen3:Bitmap,gen4:Bitmap,gen5:Bitmap;
		
		private var genObj:Object;
		
		public function Login()
		{
			super();
			init();
			this.addEventListener(Event.ENTER_FRAME,onEnterFrame);
		}
		
		public function onEnterFrame(event:Event):void {
			gen1.x += ((mouseX-stage.stageWidth/2)/25+genObj[0].x - gen1.x)*.5;

			gen2.x += ((mouseX-stage.stageWidth/2)/50+genObj[1].x - gen2.x)*.5;
				
			gen3.x += (-(mouseX-stage.stageWidth/2)/50+genObj[2].x - gen3.x)*.5;
		}
		
		public function init():void {
			
			
			
			gen1 = new pic1() as Bitmap;
			gen2 = new pic2() as Bitmap;
			gen3 = new pic3() as Bitmap;
			gen4 = new pic4() as Bitmap;
			gen5 = new pic5() as Bitmap;
			
			this.addChild(gen1);
			gen1.x = (stage.stageWidth - gen1.width)/2;
			gen1.y = (stage.stageHeight - gen1.height)/2;
			
			this.addChild(gen2);
			gen2.x = gen1.x - gen1.width/2;
			
			this.addChild(gen3);
			gen3.x = gen1.x + gen1.width/2;
			
			gen2.y = gen3.y = gen1.y;
			
			genObj = [
					{x:gen1.x},
					{x:gen2.x},
					{x:gen3.x},
					{x:gen4.x},
					{x:gen5.x}
					 ];
			
		}
	}
}